UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kbZ72ue1Ir4oPqWuxoQeNbyGimM0R/FczMUPdaWwuw=' 
WHERE 
  key_id = '2cf90e4742d6cf07b0b012632dca365b6d5b7666e5a3609191a3b6017af2f419' 
  AND (
    token = '6kbZ72ue1Ir4oPqWuxoQeNbyGimM0R/FczMUPdaWwuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058