UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PUttcxqboCQnfuF5AB2GzyidmFzg2E4r7RzCGgxPZhU='
WHERE
key_id = '4cb5634996724197e19cc37abcb910441f7b6e8fee79a3441461c19f41bb8d4f'
AND (
token = 'PUttcxqboCQnfuF5AB2GzyidmFzg2E4r7RzCGgxPZhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)