UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/6egj32vZswoHCNlofu5WgU7XZcCyG98/PTQASC9CCg=' 
WHERE 
  key_id = '752f5a732c9b17c471427f56f4483fdfb11e4363488867c2f00984178d36e127' 
  AND (
    token = '/6egj32vZswoHCNlofu5WgU7XZcCyG98/PTQASC9CCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027