UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ASsZDWNldBEo1wcXV6f+m3IilqLUB4lqUWYqCE/chc='
WHERE
key_id = '47222cdb2d81e50a4d168130952299e77dcc1287af4b5ec8cb295eeb209af238'
AND (
token = '+ASsZDWNldBEo1wcXV6f+m3IilqLUB4lqUWYqCE/chc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)