UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mf7flxXoR/HRnVbHoOdDYEKXuk4RcuD8c0vEDKzi3tQ='
WHERE
key_id = 'b54b2b2d7c6f62cb139067a10e327274795ff6da58c01433f907d455c237d542'
AND (
token = 'Mf7flxXoR/HRnVbHoOdDYEKXuk4RcuD8c0vEDKzi3tQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)