UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kSEpBQOtCv8b6pHCc/JA2yBqUUFSqN55Ba/IWQzHvVE='
WHERE
key_id = 'b2881cda1bb352580c6bd24c8e44fa5bab5ecadda55b7b6f8d6ca44636930f5a'
AND (
token = 'kSEpBQOtCv8b6pHCc/JA2yBqUUFSqN55Ba/IWQzHvVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)