UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TrvJPGQOHCp3bDHpCrVQ63L5gLi9ELkSUqc/B3uTbt4='
WHERE
key_id = 'f43125af705cfab7f37f6fe50fbcff3c44936188f4d5ec3e10889ac2d75f909b'
AND (
token = 'TrvJPGQOHCp3bDHpCrVQ63L5gLi9ELkSUqc/B3uTbt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)