UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9BRrfGeu1dUM877PKNDDcQDNLK5SU4NEEFzPZU7bsyg='
WHERE
key_id = '8728368ac1fd9f19ca336d98c182e879fa34cf3f13284fbfff68218ce8d59dab'
AND (
token = '9BRrfGeu1dUM877PKNDDcQDNLK5SU4NEEFzPZU7bsyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)