UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7IHLLlxDcWE3sTo3bZ7Vewl9Dt3mg+vykQPgGaRzEo='
WHERE
key_id = '494e6ade739f73cb7fc5f49e25a7cb1a0b8a7c69ffbbef19de098b232d923761'
AND (
token = 'A7IHLLlxDcWE3sTo3bZ7Vewl9Dt3mg+vykQPgGaRzEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)