UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TFZEJScL5Inx2kZtNaIJVsjvfx0zzKp78O58YVVh5GU='
WHERE
key_id = '85da69897be77e44dc4276582f57789cb90f7cf62ba8c362617354effda67b38'
AND (
token = 'TFZEJScL5Inx2kZtNaIJVsjvfx0zzKp78O58YVVh5GU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)