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