UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't9gVFxxzEUzSJNDxzuA39jrBoi/MfgHl/+ghyG5zfn8='
WHERE
key_id = '8bd15f86511ff30546a76c97e1ad700aaa47eb930e2c5b37f83ec8876450a4bc'
AND (
token = 't9gVFxxzEUzSJNDxzuA39jrBoi/MfgHl/+ghyG5zfn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)