UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9RNPJNXexckC6OkTP1Bsnc1A2L/fzN0Fh+VNnja0MfE='
WHERE
key_id = '011f9b593cd5533a069597157ab8bfa9550dd8ca7b2605b018b90dc6507f8059'
AND (
token = '9RNPJNXexckC6OkTP1Bsnc1A2L/fzN0Fh+VNnja0MfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)