UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7m0VhcxMZEGAxpMxyFyDeLhw8UEUFxPV4ByD6dFDYvM='
WHERE
key_id = '0e053d21c6026bfc3464fc0a8ace5d323b732f0a550d28baa8a8e1b6cb3c2b94'
AND (
token = '7m0VhcxMZEGAxpMxyFyDeLhw8UEUFxPV4ByD6dFDYvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)