UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o8M2t+u7xPJyiyP3LDOYrh1D6uhWO6D7a/FUFJxvYFg=' 
WHERE 
  key_id = 'eab7e2b4dde0687e618b0d3866b97671ae707ec8c5fed474719adb734328d8ca' 
  AND (
    token = 'o8M2t+u7xPJyiyP3LDOYrh1D6uhWO6D7a/FUFJxvYFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031