UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZpbfMHiFAGJsiCU9uCetce647s+2vi8PQUOzNXflYQ='
WHERE
key_id = 'abba2727373f9bed1f1123c9750ed7fde664c16896cb67a174f6582737af1d4c'
AND (
token = 'IZpbfMHiFAGJsiCU9uCetce647s+2vi8PQUOzNXflYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)