UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLxYO16gsifxy5HilD3L1Qq6BdMQmuSn80wNS3q5GUo='
WHERE
key_id = '0b043e5f776e223caa749400cdbc9346563b3a0d8bb4ad88a8593fbd0daa586d'
AND (
token = 'TLxYO16gsifxy5HilD3L1Qq6BdMQmuSn80wNS3q5GUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)