UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gh/DtWni9yTYllf20SCVdVi/sHlMIjDPOglHQnNtHdo='
WHERE
key_id = 'e723a6ba7ea616e7c2ac627e4fcc533bdb4e8201b58f73644f0afa8f9aab964f'
AND (
token = 'gh/DtWni9yTYllf20SCVdVi/sHlMIjDPOglHQnNtHdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)