UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4L2kv1jkZOorABfH6Laqq+ynyx9eqmu3WT8txViu234='
WHERE
key_id = 'ee8aad2463fbefd37332b19289b3209f83a2a9b9e34778fe9e17f5e12843aa8c'
AND (
token = '4L2kv1jkZOorABfH6Laqq+ynyx9eqmu3WT8txViu234='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)