UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rkvZnMXwvxYVEaCFZIeWaNPCqX+f7U9uKpJDAI49CCs='
WHERE
key_id = 'bd74a065cd0ea1956dd31b15d837aa45f8d83641582da63f31b3f49798d0ad7a'
AND (
token = 'rkvZnMXwvxYVEaCFZIeWaNPCqX+f7U9uKpJDAI49CCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)