UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQQY1fSgDdOY7mcosoBwKSVYVYUgHHIQll18MRJQl8I='
WHERE
key_id = 'fca93540d386d264c28d35ce9a8abf7489dffbab3e8949171432e742bc592b92'
AND (
token = 'PQQY1fSgDdOY7mcosoBwKSVYVYUgHHIQll18MRJQl8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)