UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lF6RW39ubEf7rd5KzUpbWhJNzeFYEVW0uOfBUth7NX8='
WHERE
key_id = '2d7e9b72d6a2366368d13c6f42dff5ca45b60cb8ed34f8dd4eb82e82f0ab067a'
AND (
token = 'lF6RW39ubEf7rd5KzUpbWhJNzeFYEVW0uOfBUth7NX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)