UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G7W3L8vl46bOujvlM/xna0KHGhO+qOpwVbSNSXBp1GY='
WHERE
key_id = '63b6b67a8fd07d81227097b0815fbf1fa40f3a586cc32679266b43a795e1c7a1'
AND (
token = 'G7W3L8vl46bOujvlM/xna0KHGhO+qOpwVbSNSXBp1GY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)