UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6x08P7fbJ83EOlGkV9OYbL7rWjB0U3iKle0fid0dCl8='
WHERE
key_id = 'fd8b53786cc85e04c1295039ceadf188253dfc2699d7a7fbad624ef1ccae45ed'
AND (
token = '6x08P7fbJ83EOlGkV9OYbL7rWjB0U3iKle0fid0dCl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)