UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DYkavJ6IF7RELo7fWabkwg4niJl3rA0qFw1N2A/bV/Y='
WHERE
key_id = 'ba3c01a8164cf2b21e8bc40ce6573c7c90207141334c7af19419ad2a80078b4d'
AND (
token = 'DYkavJ6IF7RELo7fWabkwg4niJl3rA0qFw1N2A/bV/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)