UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tZLB3oOSaN2D79XNe20Sazq6jilIwQl1LO96+1X1hEA=' 
WHERE 
  key_id = '07ec6c117dcb9f6ca23f2751a9a3cd125e4063353161eff78ed28c5f7d35dc77' 
  AND (
    token = 'tZLB3oOSaN2D79XNe20Sazq6jilIwQl1LO96+1X1hEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031