UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FB33H6/aeBulJVnXYERLUw9byicFHGm2o8hk5h8HbfU='
WHERE
key_id = 'b5e106b290f5906eaf3691d30393e5169a9e4a8bd4e479d731eead3b24de1949'
AND (
token = 'FB33H6/aeBulJVnXYERLUw9byicFHGm2o8hk5h8HbfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)