UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mm0Zvh7IDJZ6zE754Hv5jDMPQ8+gi8YKL1n3woZlXrk='
WHERE
key_id = '0be6071ef6aab2cdca9158650426dde899be4d20f19aca90f93c25a5cdd03591'
AND (
token = 'Mm0Zvh7IDJZ6zE754Hv5jDMPQ8+gi8YKL1n3woZlXrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)