UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SLqv+q1xEEIAURCJu3NBJ40P4OMCrMAn9vrbfK85gOg=' 
WHERE 
  key_id = '2b36cade306c6a6638a54a4d5a105892110f75c388587ccfb01414c8758f2ea1' 
  AND (
    token = 'SLqv+q1xEEIAURCJu3NBJ40P4OMCrMAn9vrbfK85gOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036